package com.mccken.designpattern.state.sub;

import com.mccken.designpattern.state.GumballMachine;
import com.mccken.designpattern.state.State;

/**
 * 未投币状态
 */
public class NoQuarterState implements State {
	GumballMachine gumballMachine;
	
	public NoQuarterState(GumballMachine gumballMachine) {
		this.gumballMachine = gumballMachine;
	}
	
	@Override
	public void insertQuarter() {
		System.out.println("you inserted a quarter");
		gumballMachine.setState(gumballMachine.getHasQuarterState());
	}

	@Override
	public void ejectQuarter() {
		System.out.println("NoQuarterState ejectQuarter");
	}

	@Override
	public void turnCrank() {
		System.out.println("NoQuarterState turnCrank");
	}

	@Override
	public void dispense() {
		System.out.println("NoQuarterState dispense");
	}
}